#ifndef __DEFINE_H__
#define __DEFINE_H__

#ifdef _WIN32

#include<iostream>
#include<vector>
#include<set>

#define MAP_FILE    "map.txt"

#else

#include <bits/stdc++.h>

#define MAP_FILE    "../map.txt"

#endif

#define SCALE 10
#define MINIMUM 1e-8
#define INTERATION 80

typedef std::pair<int, int> pair_int;
typedef std::pair<double, int> pair_di;

typedef enum {
    RIGHT = 0,
    LOWERRIGHT,
    LOWER,
    LOWERLEFT,
    LEFT,
    UPPERLEFT,
    UPPER,
    UPPERRIGHT
} Direction;

struct vertex{
    double x, y;// 城市坐标
    int id;// 城市编号
    int input(FILE *fp){
        return fscanf(fp, "%d %lf %lf", &id, &x, &y);
    }
};

struct Tour{//路径
    std::vector<pair_int> path;//path[i]，存储一条边(r,s)
    double L;
    //清空
    void clean(){
        L = INT_MAX;
        path.clear();
        path.shrink_to_fit();
    }
    void push_back(int x, int y){
        path.push_back(std::make_pair(x, y));
    }
    int size(){
        return (int)path.size();
    }
    int r(int i){
        return path[i].first;
    }
    int s(int i){
        return path[i].second;
    }
    void print(FILE *fp){
        int sz = path.size();
        for (int i = 0; i < sz; i ++){
            fprintf(fp, "%d->", path[i].first + 1);
        }
        fprintf(fp, "%d\n", path[sz - 1].second +                    1);
    }
    bool operator <(const Tour &a)const{
        return L < a.L;
    }//重载
};

#endif